import {createWebHistory, createWebHashHistory, createRouter} from 'vue-router'

// 首页
import homePage from '@/views/homePage/index.vue';
// 编辑页面
import editPage from '@/views/editPage/index.vue';

export const constantRoutes = [
    {
        path: '/',
        name: 'home',
        component: homePage,
    },
    {
        path: '/edit',
        name: 'edit',
        component: editPage,
    },
]

// hash模式：createWebHashHistory
// history模式:  createWebHistory

const routerHistory = createWebHashHistory();

const router = createRouter({
    history: routerHistory,
    routes: constantRoutes,
});

export default router;
